<%--
  Created by IntelliJ IDEA.
  User: 王宇航
  Date: 2023/3/11
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>addEmployee</title>
</head>
<%
   Object  o = session.getAttribute("role");
   int role = -1;
   if (o != null){
       role = (int) session.getAttribute("role");
   }
   if (role != 1){
       session.setAttribute("error","Your are not admin!");
       response.sendRedirect("index.jsp");
   }
%>
<body style="text-align: center">
<form action="/employee?action=addEmployee" method="post">
    <input type="hidden" name="action" value="addEmployee">
    <input type="text" name="name" placeholder="NAME" ><br>
    <input type="password" name="password" placeholder="PASSWORD"><br>
    <input type="text" name = "age" placeholder="AGE"><br>
    GENDER:
    <input type="radio" name="gender" value="female" checked = "checked">FEMALE
    <input type="radio" name="gender" value="male">MALE<br>
    <input type="submit" value="AddEmployee" >
</form>
<p style="color: red">
    <%
        String message =(String) session.getAttribute("message");
        if (message != null){
            out.println(message);
        }
    %>
</p>
</body>
</html>
